
/* Layout */
import Layout from '@/layout';
// 静态路由
export const constantRoutes = [
    {
        path: '/login',
        component: () => import('@/views/login/index'),
        hidden: true
    },

    {
        path: '/404',
        component: () => import('@/views/404'),
        hidden: true
    },

    {
        path: '/',
        component: Layout,
        redirect: '/dashboard',
        children: [{
            path: 'dashboard',
            name: 'Dashboard',
            component: () => import('@/views/dashboard/index'),
            meta: { title: '首页', icon: 'dashboard' }
        }]
    },

];

// 动态路由
export const asyncRoutes = [
    // 权限管理的路由
    {
        path: '/acl',
        component: Layout,
        redirect: '/acl/user',
        name: 'Acl',
        meta: { title: '权限管理', icon: 'el-icon-s-tools' },
        children: [
            {
                path: '/acl/user',
                name: 'User',
                component: () => import('@/views/acl/User/User'),
                meta: { title: '用户管理' }
            },
            {
                path: '/acl/role',
                name: 'Role',
                component: () => import('@/views/acl/Role/Role'),
                meta: { title: '角色管理' },
            },
            {
                path: '/acl/role/auth',
                name: 'Auth',
                component: () => import('@/views/acl/Role/auth'),
                meta: { title: '角色授权' },
                hidden:true
            },
            {
                path: '/acl/permission',
                name: 'Permission',
                component: () => import('@/views/acl/Permission/Permission'),
                meta: { title: '菜单管理' }
            },
        ]
    },
    // 商品管理id路由
    {
        path: '/product',
        component: Layout,
        redirect: '/product/trademark',
        name: 'Product',
        meta: { title: '商品管理', icon: 'el-icon-goods' },
        children: [
            {
                path: '/product/trademark',
                name: 'Trademark',
                component: () => import('@/views/Product/Trademark/Trademark'),
                meta: { title: '品牌管理' }
            },
            {
                path: '/product/attr',
                name: 'Attr',
                component: () => import('@/views/Product/Attr/Attr'),
                meta: { title: '平台属性管理' }
            },
            {
                path: '/product/spu',
                name: 'Spu',
                component: () => import('@/views/Product/Spu/Spu'),
                meta: { title: 'Spu管理' }
            },
            {
                path: '/product/sku',
                name: 'Sku',
                component: () => import('@/views/Product/Sku/Sku'),
                meta: { title: 'Sku管理' }
            },
        ]
    },

];
// 任意路由
export const anyRoutes = { path: '*', redirect: '/404', hidden: true };